Technology Tales

Adventures & experiences in contemporary technology

Customising Nautilus (or Files) in Ubuntu GNOME 13.04

12th September 2013

The changes made to Nautilus, otherwise known as Files, in GNOME Shell 3.6 were contentious and the response of the Linux Mint was to create their own variant called Nemo from the previous version of the application. On the Cinnamon or MATE desktop environments, the then latest version of GNOME’s file manager would have looked like a fish out of water without its application menu in the top panel on the GNOME Shell desktop. It is possible to make a few modifications that help Nautilus to look more at home on those Linux Mint desktops and I have collected them here because they are useful for GNOME Shell users too. Here they are in turn.

Adding Application Menu entries to Location Options Menu

The Location Options menu is what you get on clicking the button with the cog icon on the right-hand side of the application’s location bar. Using Gsettings, it is possible to make that menu include the sort of entries that are in the application menu in the GNOME Shell panel at the top of the screen. These include an entry for closing the whole application as well as setting its preferences (or options). Running the following command does just that (if it does not work as it should, try changing the single and double quotes to those understood by a command shell):

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} {"Gtk/ShellShowsAppMenu": <int32 0>}'

Adding in the Remove App Menu GNOME Shell extension will clean up the GNOME Shell a little by removing the application menu altogether. If, for some reason, you wish to restore the default behaviour, then the following command does the required reset:

gsettings set org.gnome.settings-daemon.plugins.xsettings overrides '@a{sv} {}'

Stopping Hiding of the Application Title Bar When Maximised

By default, GNOME Shell can hide the application title bars of GNOME applications such as Nautilus on window maximisation and this is Nautilus now works by default. Changing the behaviour so that the title bar is kept on maximised windows can be as simple as adding in the ignore_request_hide_titlebar extension. The trouble with GNOME Shell extensions is that they can stop working when a new version of GNOME Shell is used, so there’s another option: editing metacity-theme-3.xml but /usr/share/themes/Adwaita/metacity-1. The file can be opened using superuser privileges using the following command:

gksudo gedit /usr/share/themes/Adwaita/metacity-1/metacity-theme-3.xml

With the file open, it is a matter of replacing instances of ' has_title="false" ' with ' has_title="true" ', saving it and reloading GNOME Shell. This may persevere across different versions of GNOME Shell should the extension not do so.

Disabling Recursive Search

This discovery is what led me to bundle these customisations in an entry on here in the first place. In Nemo and older versions of Nautilus, just typing with the application open would lead you down a list towards the file that you wanted. This behaviour was replaced by an automatic recursive search from GNOME Shell 3.6 where the search functionality was extended beyond the folder that was open in the file manager to its subdirectories. To change that to subsetting within the open folder or directory, you need to install a patch version of Nautilus using the following commands:

sudo add-apt-repository ppa:dr3mro/personal
sudo apt-get update && sudo apt-get upgrade

The first of these adds a new repository with the patched version of Nautilus while the second combination installs the patched version. With that done, it is time to issue the following command:

gsettings set org.gnome.nautilus.preferences enable-recursive-search false

That sets the value of the new enable-recursive-search option to false for searching within an open directory. It also can be found using Dconf-Editor in the following hierarchy: org -> gnome -> nautilus -> preferences. The obsession of the GNOME project team with minimalism is robbing users of some options and this would be a good one to have by default too. Maybe the others should be treated in the same way even if you need to use Gsettings or Dconf-Editor to change them to avoid clutter. Having GNOME Tweak Tool able to set them all would be even better.

The return of the Navigator

13th June 2007

Netscape Navigator

With the launch of the ill-fated Communicator, Netscape dispensed with the Navigator brand that had served it so well up to that point. And it continued the practice when it turned to re-branding the output from the Mozilla project. The new Navigator is, in essence, a tweaked variant of Firefox’s latest incarnation and has the spelling checking capability that I have been missing when giving Safari a spin. You have to ask why and I am not certain that I have the answer. That said, it does feel slick and works well, a definite change from some of it predecessors then.

Using a variant of Debian’s Iceweasel that keeps pace with Firefox

5th February 2013

Left to its own devices, Debian will leave you with an ever ageing re-branded version of Firefox that was installed at the same time as the rest of the operating system. From what I have found, the main cause of this was that Mozilla’s wanting to retain control of its branding and trademarks in a manner not in keeping with Debian’s Free Software rules. This didn’t affect just Firefox but also Thunderbird, Sunbird and Seamonkey with Debian’s equivalents for these being IceDove, IceOwl and IceApe, respectively.

While you can download a tarball of Firefox from the web and use that, it’d be nice to get a variant that updated through Debian’s normal apt-get channels. In fact, IceWeasel does get updated whenever there is a new release of Firefox even if these updates never find their way into the usual repositories. While I have been know to take advantage of the more frozen state of Debian compared with other Linux distributions, I don’t mind getting IceWeasel updated so it isn’t a security worry.

The first step in so doing is to add the following lines to /etc/apt/sources.list using root access (using sudo, gksu or su to assume root privileges) since the file normally cannot be edited by normal users:

deb http://backports.debian.org/debian-backports squeeze-backports main
deb http://mozilla.debian.net/ squeeze-backports iceweasel-release

With the file updated and saved, the next step is to update the repositories on your machine using the following command:

sudo apt-get update

With the above complete, it is time to overwrite the existing IceWeasel installation with the latest one using an apt-get command that specifies the squeeze-backports repository as its source using the -t switch. While IceWeasel is installed from the iceweasel-release squeeze-backports repository, there dependencies that need to be satisfied and these come from the main squeeze-backports one. The actual command used is below:

sudo apt-get install -t squeeze-backports iceweasel

While that was all that I needed to do to get IceWeasel 18.0.1 in place, some may need the pkg-mozilla-archive-keyring package installed too. For those needing more information that what’s here, there’s always the Debian Mozilla team.

Tidying dynamic URL’s

15th June 2007

A few years back, I came across a very nice article discussing how you would make a dynamic URL more palatable to a search engine and I made good use of its content for my online photo gallery. The premise was that URL’s that look like that below are no help to search engines indexing a website. Though this is received wisdom in some quarters, it doesn’t seem to have done much to stall the rise of WordPress as a blogging platform.

http://www.mywebsite.com/serversidescript.php?id=394

That said, WordPress does offer a friendlier URL display option too and you can see this in use on this blog; they look a little like the example URL that you see below, and the approach is equally valid for both Perl and PHP. I have been using the same approach for the Perl scripts powering my online phone gallery and now want to apply the same thinking to a gallery written in PHP:

http://www.mywebsite.com/serversidescript.pl/id/394

The way that both expressions work is that a web server will chop pieces from a URL until it reaches a physical file. For a query URL, the extra information after the question mark is retained in its QUERY_STRING variable while extraneous directory path information is passed in the variable PATH_INFO. For both Perl and PHP, these are extracted from the entries in an array; for Perl, this array is called is $ENV and $_SERVER is the PHP equivalent. Thus, $ENV{QUERY_STRING} and $_SERVER{‘QUERY_STRING’} traps what comes after the “?” while $ENV{PATH_INFO} and $_SERVER{‘PATH_INFO’} picks up the extra information following the file name (the “/id/394/” in the example). From there on, the usual rules apply regarding cleaning of any input but changing from one to another should be too arduous.

The wonders of mod_rewrite

24th June 2007

When I wrote about tidying dynamic URL’s a little while back, I had no inkling that that would be a second part to the tale. My discovery of mod_rewrite, an Apache module that facilitates URL translation. The effect is that one URL is presented to the user in the browser address bar, and the exact same URL is also seen by search engines, while another is passed to the server for processing. It might sound like subterfuge but it works very well once you manage to get it set up properly. The web host for my hillwalking blog/photo gallery has everything configured such it is ready to go but the same did not apply to the offline Apache 2.2.x server that I have going on my own Windows XP box. There were two parts to getting it working there:

  1. Activating mod-rewrite on the server: this is as easy as uncommenting a line in the httpd.conf file for the site (the line in question is: LoadModule rewrite_module modules/mod_rewrite.so).
  2. Ensuring that the .htaccess file in the root of the web server directory is active. You need to set the values of the AllowOverride directives for the server root and CGI directories to All so that .htaccess is active. Not doing it for the latter will result in the an error beginning with the following: Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden. Having Allow from All set for the required directories is another option to consider when you see errors like that.

Once you have got the above sorted, adding this line to .htaccess: RewriteEngine On. Preceding it with an Options directive to ensure that FollowSymLinks and SymLinksIfOwnerMatch are switched on does no harm at all and may even be needed to get things running. That done, you can set about putting mod_write to work with lines like this:

RewriteRule ^pages/(.*)/?$ pages.php?query=$1

The effect of this is to take http://www.website.com/pages/input and convert it into a form for action by the server; in this case, that is http://www.website.com/pages.php?query=input. Anything contained by a bracket is assigned to the value of a system-named variable. If you have several bracketed sections, they are assigned to sequentially numbered variables as follows: $1 for the first, $2 for the second and so on. It’s all good stuff when you get it going and not only does it make things look much neater but it also possesses an advantage when it comes to future-proofing too. Web addresses can be kept constant over time, even if things change behind the scenes. It means that returning visitors will find what they saw the last time that they visited and surely must ensure good karma in eyes of those all important search engines.

Adding a new domain or subdomain to an SSL certificate using Certbot

11th June 2019

On checking the Site Health page of a WordPress blog, I saw errors that pointed to a problem with its SSL set up. The www subdomain was not included in the site’s certificate and was causing PHP errors as a result though they had no major effect on what visitors saw. Still, it was best to get rid of them so I needed to update the certificate as needed. Execution of a command like the following did the job:

sudo certbot --expand -d existing.com,www.example.com

Using a Let’s Encrypt certificate meant that I could use the certbot command since that already was installed on the server. The --expand and -d switches ensured that the listed domains were added to the certificate to sort out the observed problem. In the above, a dummy domain name is used but this was replaced by the real one to produce the desired effect and make things as they should have been.

Using .htaccess to control hotlinking

10th October 2020

There are times when blogs cease to exist and the only place to find the content is on the Wayback Machine. Even then, it is in danger of being lost completely. One such example is the subject of this post.

Though this website makes use of the facilities of Cloudflare for various functions that include the blocking of image hotlinking, the same outcome can be achieved using .htaccess files on Apache web servers. It may work on Nginx to a point too but there are other configuration files that ought to be updated instead of using a .htaccess when some frown upon the approach. In any case, the lines that need adding to .htaccess are listed below though the web address needs to include your own domain in place of the dummy example provided:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule .*\.(gif|jpe?g|png|bmp)$ [F,NC]

The first line turns on the mod_rewrite engine and you may have that done anyway. Of course, the module needs enabling in your Apache configuration for this to work and you have to be allowed to perform the required action as well. This means changing the Apache configuration files. The next pair of lines look at the HTTP referer strings and the third one only allows images to be served from your own web domain and not others. To add more, you need to copy the third line and change the web address accordingly. Any new lines need to precede the last line that defines the file extensions that are to be blocked to other web addresses.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com(/)?.*$ [NC]
RewriteRule \.(gif|jpe?g|png|bmp)$ /images/image.gif [L,NC]

Another variant of the previous code involves changing the last line to display a default image showing others what is happening. That may not reduce the bandwidth usage as much as complete blocking but it may be useful for telling others what is happening.

Mobile Phones

7th November 2010

Mobile Phones

For a long time, I wasn’t that interested in mobile telephony but a switch of job in 2010 meant that having access to the web from a mobile became desirable so I started doing that with a long relinquished BlackBerry Curve 8520; now it is Motorola hardware that I mainly use for the same kind of thing. The increased interest in mobile telephony has borne fruit in the list that you find here. The world of 3G and the devices that use it produced a learning curve for me and the availability of 5G is growing now too.

One thing that you’ll see from many a high street in the U.K. is the profusion of shops operated by mobile phone network operators and it is the same in Éire (the indigenous operator Eir has impressed me over there). These networks sell you their wares online too and that is why they are listed in their own section at the bottom. Before their listing, I have collected whatever retailers there are that are not attached to any network and there didn’t seem to be that many of them when I set up the list but it’s grown a good bit since then due to my perusing the occasional mobile phone magazine. If I find any more of these, I’ll add them on here.

Independent Retailers

Carphone Warehouse

These are the people with whom I have had the most dealings since I got my first ever mobile phone from them, a Motorola that I kept using until it battery kept losing its charge quickly on me. More recently, I picked up a Nokia 1661 from them that needed a look at the manual to get its call volume set properly.

buymobiles.net

If these didn’t sponsor the Buyer’s Guide in Smartphone Essentials magazine, I never would have heard of them; Derby County FC supporters should have seen their logo on the player’s shirts but I cannot say that I am a football fan. A look at the website confirms the presence of a comprehensive selection of phones for sale, contracted or otherwise.

Clove Technology

Compared to the others, this outlet is unusual in offering only phones without contracts or pay-as-you-go arrangements. In other words, it is a place for someone running the gauntlet of the cost of going for a SIM-free phone. Saying that, they have their place and many tariffs are puffed up to pay for the more expensive device that is provided to you as part of the contract; that’s why you are tied in for a certain length of time too, so as ensure that the cost of the phone is recovered.

AffordableMobiles.co.uk

The name may be new to me but its Derbyshire based parent company has been involved in mobile phone reselling for more than a decade. The range that the website supplies includes not controlled contracted and pay as you go phones but also SIM cards and phones without SIM cards. That makes it worth a look along with others like it.

Networks

3

Haven’t had much to do with these people apart from poking around their website looking at what SIM-only deals that they have. However, hearing the experiences of others with their network takes the shine off their offer.

EE

From the point of view of network coverage, this operator looks like your best option and would be who I would choose if I had my chance again; there have been parts of Wales and Scotland where I otherwise not have had mobile signal with my O2 account and Vodafone users were left bereft in the case of the Welsh location of Port Eynon. It was a T-Mobile PAYG BlackBerry Curve 8520 that brought me their way in 2010 and the merger with Orange soon showed its advantages when it came to network improvements. A PAYG mobile WiFi modem followed in 2011 and that uses the SIM card from a defunct Huawei mobile broadband dongle. The BlackBerry was traded for cash once a phone upgrade made available an older HTC to replace the thing; it was hideously slow and that may have had more to do with the phone that its 2G data connection. More recently, a backup Moto makes use of a PAYG account and that is how things look for now.

O2

As it happens, I have been with this bunch since they were part of BT and known as Cellnet. The transformation to O2 and subsequent incorporation into Telefonica and Virgin Media has not meant any disruption. Their BT origins and being part of the first wave of operators has meant that network coverage is reasonable too, though voice services do come out better than data ones so that needs to be kept in mind.

Vodafone

For a global operator, their British and Irish networks leave something to be desired and the British one got slated in an industry appraisal. That fits with the pay-as-you-go mobile broadband dongle experience in the U.K. as well as hit and miss attempts calling Vodafone network users in Ireland. Let’s hope that those network problems get sorted because good phones need equally good connections.

Getting rid of a Dropbox error message on a Linux-powered PC

24th September 2012

One of my PC’s has ended up becoming a testing ground for a number of Linux distributions. The list has included openSUSE, Fedora, Arch and LMDE with Sabayon being the latest incumbent. From Arch onwards in that list though, a message has appeared on loading the desktop with every one of these when I have Dropbox’s client set up on there:

Unable to monitor entire Dropbox folder hierarchy. Please run “echo 100000 | sudo tee /proc/sys/fs/inotify/max_user_watches” and restart Dropbox to correct the problem.

Even applying the remedy that the message suggests won’t permanently fix the problem. For that, you need to edit /etc/sysctl.conf with superuser access and add the following line to it:

fs.inotify.max_user_watches = 100000

With that in place, you can issue the following command to fix the problem in the current session (assuming your user account is listed in /etc/sudoers):

sudo sysctl -p & dropbox stop & dropbox start

A reboot should demonstrate that the messages no longer appear again. For a good while, I had ignored it but curiosity eventually got me to find out how it could be stopped and led to what you find above.

ASCII Codes

24th August 2015

Having found myself looking for this from time to time, here is a table of ASCII characters and their representation in decimal, hexadecimal and octal forms together with the corresponding HTML entities. The first on the list are various non-printing characters and I have found myself using the TAB one in programming quiet often over the years. Currently, only the core ASCII characters appear but those from the extended set may be added later.

DecimalHexadecimalOctalCharacterHTML
00000NUL (null)
11001SOH (start of heading)
22002STX (start of text)
33003ETX (end of text)
44004ETX (end of transmission)
55005ENQ (enquiry)
66006ACK (acknowledge)
77007BEL (bell)
88010BS (backspace)
99011TAB (horizontal tab)
10A012LF (NL line feed, newline)
11B013VT (vertical tab)
12C014FF (NP form feed, new page)
13D015CR (carriage return)
14E016SO (shift out)
15F017SI (shift in)
1610020DLE (data link escape)
1711021DC1 (device control 1)
1812022DC2 (device control 2)
1913023DC3 (device control 3)
2014024DC4 (device control 4)
2115025NAK (negative acknowledge)
2216026SYN (synchronous idle)
2317027ETB (end of transmission block)
2418030CAN (cancel)
2519031EM (end of medium)
261A032SUB (substitution)
271B033ESC (escape)
281C034FS (file separator)
291D035GS (group separator)
301E036RS (record separator)
311F037US (unit separator)
3220040space&#32;
3321041!&#33;
3422042&#34;
3523043#&#35;
3624044$&#36;
3725045%&#37;
3826046&&#38;
3927047&#39;
4028050(&#40;
4129051)&#41;
422A052*&#42;
432B053+&#43;
442C054,&#44;
452D055--&#45;
462E056.&#46;
472F057/&#47;
48300600&#48;
49310611&#49;
50320622&#50;
51330633&#51;
52340644&#52;
53350655&#53;
54360666&#54;
55370677&#55;
56380708&#56;
57390719&#57;
583A072:&#58;
593B073;&#59;
603C074<&#60;
613D075=&#61;
623E076>&#62;
633F077?&#63;
6440100@&#64;
6541101A&#65;
6642102B&#66;
6743103C&#67;
6844104D&#68;
6945105E&#69;
7046106F&#70;
7147107G&#71;
7248110H&#72;
7349111I&#73;
744A112J&#74;
754B113K&#75;
764C114L&#76;
774D115M&#77;
784E116N&#78;
794F117O&#79;
8050120P&#80;
8151121Q&#81;
8252122R&#82;
8353123S&#83;
8454124T&#84;
8555125U&#85;
8656126V&#86;
8757127W&#87;
8858130X&#88;
8959131Y&#89;
905A132Z&#90;
915B133[&#91;
925C134\&#92;
935D135]&#93;
945E136^&#94;
955F137 _&#95;
9660140`&#96;
9761141a&#97;
9862142b&#98;
9963143c&#99;
10064144d&#100;
10165145e&#101;
10266146f&#102;
10367147g&#103;
10468150h&#104;
10569151i&#105;
1066A152j&#106;
1076B153k&#107;
1086C154l&#108;
1096D155m&#109;
1106E156n&#110;
1116F157o&#111;
11270160p&#112;
11371161q&#113;
11472162r&#114;
11573163s&#115;
11674164t&#116;
11775165u&#117;
11876166v&#118;
11977167w&#119;
12078170x&#120;
12179171y&#121;
1227A172z&#122;
1237B173{&#123;
1247C174|&#124;
1257D175}&#125;
1267E176~&#126;
1277F177DEL&#127;
  • All the views that you find expressed on here in postings and articles are mine alone and not those of any organisation with which I have any association, through work or otherwise. As regards editorial policy, whatever appears here is entirely of my own choice and not that of any other person or organisation.

  • Please note that everything you find here is copyrighted material. The content may be available to read without charge and without advertising but it is not to be reproduced without attribution. As it happens, a number of the images are sourced from stock libraries like iStockPhoto so they certainly are not for abstraction.

  • With regards to any comments left on the site, I expect them to be civil in tone of voice and reserve the right to reject any that are either inappropriate or irrelevant. Comment review is subject to automated processing as well as manual inspection but whatever is said is the sole responsibility of the individual contributor.